package main

import "fmt"

func main() {
	ch := make(chan int)
	go sendCh(ch)

	for num := range ch {
		fmt.Println(num)
	}
}

func sendCh(ch chan int) {
	for i := 0; i < 10; i++ {
		ch <- i
	}
	close(ch)
}
